package com.baomidou.ant.utils;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

public class compareDate {
    public static Boolean dateToYMD(LocalDateTime thisTime, LocalDateTime pastTime) {
        DateTimeFormatter formatter =DateTimeFormatter.ofPattern("yyyyMMdd");
        if(pastTime==null){
            return Integer.parseInt(formatter.format(thisTime)) == 0;
        }
        return Integer.parseInt(formatter.format(thisTime)) == Integer.parseInt(formatter.format(pastTime));
    }
}
